home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / exceptio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  5.3 KB  |  181 lines

  1. /* This file is included specially and does not have a normal header guard */
  2. #pragma option push -b -a4 -Vx- -Ve- -w-inl -w-aus -w-sig
  3. #ifndef __STD_EXCEPTION
  4.  
  5. /***************************************************************************
  6.  *
  7.  * exception - declarations for the Standard Library exception class
  8.  *
  9.  * $Id: exception,v 1.23 1996/08/28 01:28:39 smithey Exp $
  10.  *
  11.  ***************************************************************************
  12.  *
  13.  * (c) Copyright 1994, 1995 Rogue Wave Software, Inc.
  14.  * ALL RIGHTS RESERVED *
  15.  * The software and information contained herein are proprietary to, and
  16.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  17.  * intends to preserve as trade secrets such software and information.
  18.  * This software is furnished pursuant to a written license agreement and
  19.  * may be used, copied, transmitted, and stored only in accordance with
  20.  * the terms of such license and with the inclusion of the above copyright
  21.  * notice.  This software and information or any other copies thereof may
  22.  * not be provided or otherwise made available to any other person.
  23.  *
  24.  * Notwithstanding any other lease or license that may pertain to, or
  25.  * accompany the delivery of, this computer software and information, the
  26.  * rights of the Government regarding its use, reproduction and disclosure
  27.  * are as set forth in Section 52.227-19 of the FARS Computer
  28.  * Software-Restricted Rights clause.
  29.  *
  30.  * Use, duplication, or disclosure by the Government is subject to
  31.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  32.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  33.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  34.  * P.O. Box 2328, Corvallis, Oregon 97339.
  35.  *
  36.  * This computer software and information is distributed with "restricted
  37.  * rights."  Use, duplication or disclosure is subject to restrictions as
  38.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  39.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  40.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  41.  * then the "Alternate III" clause applies.
  42.  *
  43.  **************************************************************************/
  44.  
  45. #include <stdcomp.h>
  46.  
  47. #ifndef __EXCEPT_H
  48. #  include <except.h>
  49. #endif
  50.  
  51. #include "rw/stddefs.h"
  52.  
  53. #ifndef __RWSTD_EXCEPTION_SEEN
  54.  
  55. #ifndef _RWSTD_EXCEPTION_HANDLER_IN_STD
  56.  
  57. typedef void (*terminate_handler) ();
  58. extern terminate_handler set_terminate(terminate_handler f) _RWSTD_THROW_SPEC_NULL;
  59. extern void terminate( );
  60.  
  61. typedef void (*unexpected_handler) ();
  62. extern unexpected_handler set_unexpected( unexpected_handler f)  _RWSTD_THROW_SPEC_NULL;
  63. extern void unexpected();
  64.  
  65. #endif /* _RWSTD_EXCEPTION_HANDLER_IN_STD */
  66.  
  67. #ifndef _RWSTD_NO_NAMESPACE
  68. namespace __rwstd {
  69. #endif
  70.  
  71. extern const char _RWSTDExportFunc(*) __rw_stdexcept_NoNamedException;
  72. extern const char _RWSTDExportFunc(*) __rw_stdexcept_BadException;
  73.  
  74. #ifndef _RWSTD_NO_NAMESPACE 
  75. }
  76. #endif
  77.  
  78. #ifndef _RWSTD_NO_NAMESPACE 
  79. namespace std {
  80. #endif
  81.  
  82. //
  83. // Temporarily turn off the warnings under the Borland compiler that
  84. // say 'Functions containing ... cannot be inlined'
  85. //
  86. #if defined(__BORLANDC__)
  87. #pragma option -w-inl
  88. #endif
  89.  
  90. #ifdef _RWSTD_EXCEPTION_DEFINED
  91. // MSVC < 4.2  has its own (non-standard) exception class.  We need to use it
  92. // in order to allow the use of MSVC typeinfo exception classes 
  93. // derived from it.
  94. #if defined(_MSC_VER) 
  95. #ifndef _RWSTD_NO_NAMESPACE 
  96. }
  97. #endif
  98. #if _MSC_VER < 1011
  99. #include <exception.h>
  100. #else
  101. // MSVC 4.2
  102. // Here we must use their standard exception class since they've already 
  103. // compiled it into their libraries
  104. //
  105. #include _RWSTD_MS42_HEADER(exception) 
  106. #endif /*  _MSC_VER < 1011 */
  107. #ifndef _RWSTD_NO_NAMESPACE 
  108. namespace std {
  109. #endif
  110. #else
  111. #include <stdexcept.h>
  112. #endif /* _MSC_VER */
  113.  
  114. #else
  115. class _RWSTDExport exception     
  116.   public:
  117.     exception () _RWSTD_THROW_SPEC_NULL
  118.     { ; }
  119.     exception (const exception&) _RWSTD_THROW_SPEC_NULL 
  120.     { ; }
  121.     exception& operator= (const exception&)  _RWSTD_THROW_SPEC_NULL
  122.     { return *this; }
  123.     virtual ~exception ()  _RWSTD_THROW_SPEC_NULL
  124. #ifndef HPPA_WA
  125.     { ; }  
  126. #else
  127.     ;
  128. #endif
  129.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  130.     {
  131.         return  __RWSTD::__rw_stdexcept_NoNamedException;
  132.     }
  133. };
  134.  
  135. #endif /* _RWSTD_EXCEPTION_DEFINED */
  136.  
  137. #if !defined(_RWSTD_BAD_EXCEPTION_DEFINED)
  138. class _RWSTDExport bad_exception : public exception     
  139.   public:
  140.     bad_exception () _RWSTD_THROW_SPEC_NULL : exception( )
  141.     { ; }
  142.     bad_exception(const bad_exception&) _RWSTD_THROW_SPEC_NULL
  143.     { ; }
  144.     bad_exception& operator=(const bad_exception&) _RWSTD_THROW_SPEC_NULL
  145.     { return *this; }
  146.     virtual ~bad_exception ()  _RWSTD_THROW_SPEC_NULL
  147. #ifndef HPPA_WA
  148.     { ; }  
  149. #else
  150.     ;
  151. #endif
  152.  
  153.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  154.     {
  155.         return __RWSTD::__rw_stdexcept_BadException;
  156.     }
  157. };
  158. #endif  /* _RWSTD_BAD_EXCEPTION_DEFINED */
  159.  
  160. #define __RWSTD_EXCEPTION_SEEN
  161.  
  162. #ifndef _RWSTD_NO_NAMESPACE 
  163. #endif
  164.  
  165. //
  166. // Yes, the exception hierarchy has been seen!
  167. //
  168. #endif /*__RWSTD_EXCEPTION_SEEN*/
  169.  
  170. //
  171. // Yes, the complete file has been processed!
  172. //
  173. #define __STD_EXCEPTION
  174.  
  175. #endif /*__STD_EXCEPTION */
  176.  
  177. #pragma option pop
  178.